import React, { useState } from 'react'
import { Lunar} from 'lunar-javascript'
import icon from '../../../public/image/节日.png'
function Calendar() {
    const currenDate = new Date()
    const year = currenDate.getFullYear(); //获取年份
    const month = currenDate.getMonth()+1; //获取月份
    const day = currenDate.getDate(); //获取天数

    const c = Lunar.fromDate(new Date());
    const im = c.getMonthInChinese();  //获取中文 月
    const vom = c.getDayInChinese(); //获取中文 日
    const wochen = c.getWeekInChinese(); //获取中文 周

    const [lucky,setLucky] = useState('幸运日')
  return (
    <>
      <div>
          <b><span style={{fontSize:'23px'}}>{day}</span>/{month}&nbsp;&nbsp;{year}</b>
          <p style={{fontSize:'12px'}}>周{wochen}&nbsp;农历{im}&nbsp;月{vom}</p>
      </div>
      <div style={{display:'flex',alignItems:'center'}}>
            <img src={icon} alt="" style={{width:'30px'}}/> <b>{lucky}</b>
      </div>
    </>
  )
}

export default Calendar